const { Menu, BrowserWindow } = require("electron");

var template = [
  {
    label: "连接平台",
    submenu: [
      {
        label: "梯控",
        accelerator: `ctrl+n`,
        //主要代码--------------start
        click: () => {
          win = new BrowserWindow({
            width: 500,
            height: 500,
            webPreferences: { nodeIntegration: true },
          });
          win.loadFile("yellow.html");
          win.on("closed", () => {
            win = null;
          });
        },
        //主要代码----------------end
      },
      { label: "人脸" },
    ],
  },
  {
    label: "物联云平台",
    submenu: [{ label: "酒管" }, { label: "能源" }],
  },
];

var m = Menu.buildFromTemplate(template);

Menu.setApplicationMenu(m);
